using Engine;
using Engine.Graphics;
using Game;
using static ModsManageContentScreen;

namespace SCIENEW {
	public static class ItemsBlockManager {
		public static ItemBlock[] Items;
		/// <summary>
		/// 方块字符串ID（合成ID）与其完整值对应表
		/// </summary>
		public static Dictionary<string, int> IdMap;

		public static void Init() {

            try {
			Items =
				[
				//矿粉
				new OrePowderItem(Materials.Iron),
				new OrePowderItem(Materials.Copper),
				new OrePowderItem(Materials.Germanium),
				new OrePowderItem(Materials.Gold),
				new OrePowderItem(Materials.Silver),
				new OrePowderItem(Materials.Platinum),
				new OrePowderItem(Materials.Lead),
				new OrePowderItem(Materials.Stannary),
				new OrePowderItem(Materials.Zinc),
				new OrePowderItem(Materials.Chromium),
				new OrePowderItem(Materials.Nickel),
				new OrePowderItem(Materials.Aluminum, false),
				new OrePowderItem(Materials.Titanium),
				new OrePowderItem(Materials.Uranium),
                //金属矿石块
				new OreChunkItem(Matrix.CreateRotationX(4f) * Matrix.CreateRotationZ(2f), Matrix.CreateTranslation(32 % 16 / 16f, 32 / 16 / 16f, 0f), Color.White, false, Materials.Gold),
				new OreChunkItem(Matrix.CreateRotationX(5f) * Matrix.CreateRotationZ(2f), Matrix.CreateTranslation(33 % 16 / 16f, 33 / 16 / 16f, 0f), Color.White, false, Materials.Silver),
				new OreChunkItem(Matrix.CreateRotationX(6f) * Matrix.CreateRotationZ(2f), Matrix.CreateTranslation(34 % 16 / 16f, 34 / 16 / 16f, 0f), Color.White, false, Materials.Platinum),
				new OreChunkItem(Matrix.CreateRotationX(1f) * Matrix.CreateRotationZ(3f), Matrix.CreateTranslation(35 % 16 / 16f, 35 / 16 / 16f, 0f), Color.LightGray, false, Materials.Lead),
				new OreChunkItem(Matrix.CreateRotationX(1f) * Matrix.CreateRotationZ(4f), Matrix.CreateTranslation(36 % 16 / 16f, 36 / 16 / 16f, 0f), new Color(65, 224, 205), false, Materials.Zinc),
				new OreChunkItem(Matrix.CreateRotationX(1f) * Matrix.CreateRotationZ(5f), Matrix.CreateTranslation(37 % 16 / 16f, 37 / 16 / 16f, 0f), new Color(225, 225, 225), false, Materials.Stannary),
				new OreChunkItem(Matrix.CreateRotationX(1f) * Matrix.CreateRotationZ(6f), Matrix.CreateTranslation(38 % 16 / 16f, 38 / 16 / 16f, 0f), Color.White, false, Materials.Mercury),
				new OreChunkItem(Matrix.CreateRotationX(1f) * Matrix.CreateRotationZ(7f), Matrix.CreateTranslation(39 % 16 / 16f, 39 / 16 / 16f, 0f), Color.White, false, Materials.Chromium),
				new OreChunkItem(Matrix.CreateRotationX(2f) * Matrix.CreateRotationZ(-1f), Matrix.CreateTranslation(40 % 16 / 16f, 40 / 16 / 16f, 0f), new Color(190, 190, 190), false, Materials.Titanium),
				new OreChunkItem(Matrix.CreateRotationX(3f) * Matrix.CreateRotationZ(-1f), Matrix.CreateTranslation(41 % 16 / 16f, 41 / 16 / 16f, 0f), Color.White, false, Materials.Nickel),
				new OreChunkItem(Matrix.CreateRotationX(3f) * Matrix.CreateRotationZ(-2f), Matrix.CreateTranslation(42 % 16 / 16f, 41 / 16 / 16f, 0f), Color.White, false, Materials.Uranium),
				new OreChunkItem(Matrix.CreateRotationX(3f) * Matrix.CreateRotationZ(-3f), Matrix.CreateTranslation(43 % 16 / 16f, 41 / 16 / 16f, 0f), Color.White, true, Materials.Phosphorus),
				new ScrapIronItem(),
                //金属锭
                new MetalIngotItem(Materials.Steel),
				new MetalIngotItem(Materials.Gold, true),
				new MetalIngotItem(Materials.Silver, true),
				new MetalIngotItem(Materials.Platinum, true),
				new MetalIngotItem(Materials.Lead, true),
				new MetalIngotItem(Materials.Zinc, true),
				new MetalIngotItem(Materials.Stannary, true),
				new MetalIngotItem(Materials.Chromium),
				new MetalIngotItem(Materials.Titanium),
				new MetalIngotItem(Materials.Nickel, true),
				new MetalIngotItem(Materials.Aluminum),
				new MetalIngotItem(Materials.Germanium, true),
				new MetalIngotItem(Materials.FeAlCrAlloy),
				new MetalIngotItem(Materials.Brass),
				new MetalIngotItem(Materials.Vanadium),
				new MetalIngotItem(Materials.Cupronickel),
                //金属板
                new PlateItem(Materials.Steel),
				new PlateItem(Materials.Gold),
				new PlateItem(Materials.Silver),
				new PlateItem(Materials.Lead),
				new PlateItem(Materials.Platinum),
				new PlateItem(Materials.Zinc),
				new PlateItem(Materials.Stannary),
				new PlateItem(Materials.Chromium),
				new PlateItem(Materials.Titanium),
				new PlateItem(Materials.Nickel),
				new PlateItem(Materials.Aluminum),
				new PlateItem(Materials.Iron),
				new PlateItem(Materials.Copper),
				new PlateItem(Materials.Germanium),
				new PlateItem(Materials.FeAlCrAlloy),
				new PlateItem(Materials.Brass),
				new PlateItem(Materials.Vanadium),
				new PlateItem(Materials.Cupronickel),
                //金属丝
                new MetalLineItem(Materials.Steel),
				new MetalLineItem(Materials.Gold),
				new MetalLineItem(Materials.Silver),
				new MetalLineItem(Materials.Lead),
				new MetalLineItem(Materials.Platinum),
				new MetalLineItem(Materials.Zinc),
				new MetalLineItem(Materials.Stannary),
				new MetalLineItem(Materials.Chromium),
				new MetalLineItem(Materials.Titanium),
				new MetalLineItem(Materials.Nickel),
				new MetalLineItem(Materials.Aluminum),
				new MetalLineItem(Materials.Iron),
				new MetalLineItem(Materials.Copper),
				new MetalLineItem(Materials.Germanium),
				new MetalLineItem(Materials.FeAlCrAlloy),
				new MetalLineItem(Materials.Brass),
				new MetalLineItem(Materials.Vanadium),
				new MetalLineItem(Materials.Cupronickel),
				new RodItem("RifleBarrel", Color.Gray),
                //金属粉末
                new PowderItem(Materials.Steel),
				new PowderItem(Materials.Gold),
				new PowderItem(Materials.Silver),
				new PowderItem(Materials.Lead),
				new PowderItem(Materials.Platinum),
				new PowderItem(Materials.Zinc),
				new PowderItem(Materials.Stannary),
				new PowderItem(Materials.Chromium),
				new PowderItem(Materials.Titanium),
				new PowderItem(Materials.Nickel),
				new PowderItem(Materials.Aluminum),
				new PowderItem(Materials.Iron),
				new PowderItem(Materials.Copper),
				new PowderItem(Materials.Germanium),
				new PowderItem(Materials.FeAlCrAlloy),
				new PowderItem(Materials.Brass),
				new PowderItem(Materials.Vanadium),
				new PowderItem(Materials.Cupronickel),
				new CoalPowderItem("CoalPowder", new Color(28, 28, 28), 2, 60),
				new CoalPowderItem("CokeCoalPowder", Color.DarkGray, 3, 100),
                //金属片
                new PlateItem(Materials.Steel, true),
				new PlateItem(Materials.Gold, true),
				new PlateItem(Materials.Silver, true),
				new PlateItem(Materials.Lead, true),
				new PlateItem(Materials.Platinum, true),
				new PlateItem(Materials.Zinc, true),
				new PlateItem(Materials.Stannary, true),
				new PlateItem(Materials.Chromium, true),
				new PlateItem(Materials.Titanium, true),
				new PlateItem(Materials.Nickel, true),
				new PlateItem(Materials.Aluminum, true),
				new PlateItem(Materials.Iron, true),
				new PlateItem(Materials.Copper, true),
				new PlateItem(Materials.Germanium, true),
				new PlateItem(Materials.FeAlCrAlloy, true),
				new PlateItem(Materials.Brass, true),
				new PlateItem(Materials.Vanadium, true),
				new PlateItem(Materials.Cupronickel, true),
                //金属棍
                new RodItem(Materials.Steel),
				new RodItem(Materials.Gold),
				new RodItem(Materials.Silver),
				new RodItem(Materials.Lead),
				new RodItem(Materials.Platinum),
				new RodItem(Materials.Zinc),
				new RodItem(Materials.Stannary),
				new RodItem(Materials.Chromium),
				new RodItem(Materials.Titanium),
				new RodItem(Materials.Nickel),
				new RodItem(Materials.Aluminum),
				new RodItem(Materials.Copper),
				new RodItem(Materials.Germanium),
				new RodItem(Materials.FeAlCrAlloy),
				new RodItem(Materials.Brass),
				new RodItem(Materials.Vanadium),
				new RodItem(Materials.Cupronickel),
				new SteelGearItem(),
				new SteelWheelItem(),
				new MeshItem("IndustrialPiston", "Models/Piston", "Piston", ContentManager.Get<Texture2D>("Textures/Iron"), MaterialsUtils.GetColor(Materials.Steel),  Matrix.CreateRotationZ(-MathF.PI / 4) * Matrix.CreateRotationX(MathUtils.DegToRad(90f)) * Matrix.CreateTranslation(0.6f, 1f, 0.5f), Matrix.Identity, 1.5f),
				new WireItem("CopperWire"),
				new MeshItem( "IndustrialMagnet", "Models/UIronSheet", "UIronSheet", ContentManager.Get<Texture2D>("Textures/Iron"), MaterialsUtils.GetColor(Materials.Lead), Matrix.CreateScale(1.5f) * Matrix.CreateTranslation(0, 0.5f, 0), Matrix.Identity),
				new BrickItem( "RefractoryBrick", Color.White, Matrix.CreateTranslation(-2 / 16f, -4 / 16f, 0), IndustrialModLoader.IETexture),
				new CokeCoalItem(),
				new FanItem(Materials.Steel),
				new FanItem(Materials.Aluminum),
				new SteamBoatItem(),
				new TrainItem(),
				new CarriageItem(),
				new CoalPowderItem( "NaCLPowder", Color.White, 0, 0),
				new IEFlatItem( "SifterMeshItem",  218),
				new BulletItem("FixedBullet", IndustrialModLoader.IETexture,177, 0, 0, 0.5f),
				new BulletItem("IronBullet",  IndustrialModLoader.BaseTexture, 229, 90f, 0.1f),
				new FlaxSeedItem(),
				new IEFlatItem("FlaxFiber",  6){Category = "Plants"},
				new WrenchsItem(),
                new ModuleItem("IngotModule", "IngotModule", typeof(MetalIngotItem)),
                new ModuleItem("PlateModule", "PlateModule", typeof(PlateItem)),
                new ModuleItem("RodModule", "RodModule", typeof(RodItem)),
                new ModuleItem("GearModule", "GearModule", typeof(SteelGearItem)),
                new ModuleItem("WheelModule", "WheelModule", typeof(SteelWheelItem)),
                new ModuleItem("UIronSheetModule", "UIronSheetModule", typeof(UIronSheetItem)),
                new UIronSheetItem(),
                #if false
				new CarriageItem(),
				new AirshipItem(),
				new IcebreakerItem(),
				new PowderItem("煤渣", "Ashes", new Color(125, 70, 70)),
				new PowderItem("海带灰", "KelpAshes", Color.DarkGreen),
				new BucketItem("海带灰溶液", "KelpAshSolution", "",  Color.DarkGreen),
				new PowderItem("矿渣", "Slag", new Color(40, 40, 40)),
				new PowderItem("木屑", "Sawdust", new Color(255, 255, 160)),
				new PowderItem("碎砖", "Brickbat", Color.DarkRed),
				new PowderItem("碎玻璃", "BrokenGlass", Color.White),
				//new Cylinder(Matrix.CreateScale(70f)),
				//new FuelCylinder(Matrix.CreateScale(70f), "液化石油气", 1100, 300),
				//new FuelCylinder(Matrix.CreateScale(70f), "液化天然气", 700, 240),
				//new Cylinder(Matrix.CreateScale(40f, 80f, 40f), "He"),
				//new Cylinder(Matrix.CreateScale(40f, 80f, 40f), "Ar"),
				new PowderItem("粗盐", "CrudeSalt", Color.White),
				new BrickItem("石墨", "Graphite", new Color(44, 44, 44), Matrix.CreateTranslation(-32 % 16 / 16f, -32 / 16 / 16f, 0f), "石墨"),
				//new PurePowder("Si", Color.DarkGray)
				//{
				//    DefaultDisplayName = "粗硅"
				//},
				new PowderItem("明矾", "Alum", Color.White),
				new PowderItem("石英砂", "QuartzPowder", Color.White),
				new PowderItem("苔粉", "Lichenin", Color.DarkGreen),
				new FlatItem("滑石","Talcum",231),
				new PowderItem("滑石粉", "TalcumPowder", Color.White),
				new FlatItem("基因查看器","GeneScope",122),
				new MeshItem("螺丝刀", "Screwdriver", "Models/Screwdriver", "obj1", ContentManager.Get<Texture2D>("Textures/Iron"), MaterialsUtils.GetColor(Materials.Aluminum), Matrix.CreateTranslation(0f, -0.33f, 0f), Matrix.Identity, "螺丝刀可以快速拆除机器", 3.3f){Category = "Tools"},
				new MeshItem("扳手", "Wrench", "Models/Wrench", "obj1", ContentManager.Get<Texture2D>("Textures/Iron"), MaterialsUtils.GetColor(Materials.Aluminum), Matrix.CreateScale(1.2f), Matrix.Identity, "扳手可以拆除交通工具", 6f){Category = "Tools"},
				new OreChunkItem(Matrix.CreateRotationX(1f) * Matrix.CreateRotationZ(1f), Matrix.CreateTranslation(0.0625f, 0.4375f, 0f), Color.White, false, Materials.Steel)
				{
					Id = "Plaster",
					DisplayName = "石膏",
					Description = "石膏"
				},
				new PowderItem("石膏粉", "Gesso", Color.White),
				new PowderItem("冰晶石", "Cryolite", Color.White),
				new MeshItem("活塞连杆", "Cylinder", "Models/Piston2", "Cylinder", ContentManager.Get<Texture2D>("Textures/Iron"), MaterialsUtils.GetColor(Materials.Steel), Matrix.CreateRotationX(-MathF.PI / 2) * Matrix.CreateTranslation(0, 0.6f, 0), Matrix.Identity, "这个由合金，铝和钢制成的圆筒，是许多机器的必要零件。", 0.9f),
				//new LightMould("Models/Snowball", "Snowball", m, m2, "A Ball of Melting Iron.", "MeltingIron"),
				//new LightMould("Models/Snowball", "Snowball", m, m2, "A Ball of Melting Chromium.", "MeltingChromium"),
				//new LightMould("Models/Snowball", "Snowball", m, m2, "A Ball of Melting Nickel.", "MeltingNickel"),
				//new LightMould("Models/Snowball", "Snowball", m, m2, "A Ball of Melting Titanium.", "MeltingTitanium"),
				//new LightMould("Models/Snowball", "Snowball", m, m2, "A Ball of Melting Aluminium.", "MeltingAluminium"),
				//new LightMould("Models/Snowball", "Snowball", m, m2, "A Ball of Melting Copper.", "MeltingCopper"),
				//new LightMould("Models/Snowball", "Snowball", m, m2, "A Ball of Melting Zinc.", "MeltingZinc"),
				new AlloyItem(Materials.Steel,"Stainless Steel", "StainlessSteel"),
				new AlloyItem(Materials.Aluminum, "Super Aluminium", "SuperAluminium"),
				new AlloyItem(Materials.Steel, "Si-Steel", "Si-Steel"),
				new AlloyItem(Materials.Steel,"Industrial Steel", "IndustrialSteel"),
				new AlloyItem(Materials.Copper,"Industrial Copper", "IndustrialCopper"),
				new AlloyItem(Materials.Steel,"Titanium Steel", "TitaniumSteel"),
				new AlloyItem(Materials.Chromium,"Gun-Steel", "Gun-Steel"),
				new PowderItem("酵母", "Yeast", Color.White),
				new BrickItem("混凝土砖", "ConcreteBrick", Color.Gray, Matrix.CreateTranslation(-32 % 16 / 16f, -32 / 16 / 16f, 0f), "混凝土砖"),
				new BrickItem("多孔混凝土砖", "PorousConcreteBrick", Color.Gray, Matrix.CreateTranslation(-32 % 16 / 16f, -32 / 16 / 16f, 0f), "多孔混凝土砖"),
				new PlateItem("多晶硅", "PolyCrystallineSilicon", Color.DarkGray, true),
				new PlateItem("单晶硅", "MonoCrystallineSilicon", Color.DarkGray, true),
				new MeshItem("橡胶", "Rubber", "Models/Snowball", "Snowball", IndustrialModLoader.BaseTexture, Color.White, Matrix.CreateScale(3) * Matrix.CreateTranslation(0, 0.4f, 0), Matrix.CreateTranslation(12f / 16f, -1f / 16f, 0f), "A Ball of Rubber, an important component in the advanced industry"),
				//new FoodCan("空罐头能用于制作食物罐头","Empty",Color.Gray),
				//new FoodCan("肉罐头可以长时间储存肉","Meat",Color.Gray),
				//new FoodCan("鸡肉罐头可以长时间储存鸡肉","Chicken",Color.Gray),
				//new FoodCan("南瓜罐头可以长时间储存南瓜","Pumpkin",Color.Gray),
				//new FoodCan("面包罐头可以长时间储存面包","Bread",Color.Gray),
				//new FoodCan("鱼罐头可以长时间储存鱼","Fish",Color.Gray),
				new BrickItem("玻璃砖", "玻璃砖", new Color(255, 255, 255, 32), Matrix.CreateTranslation(-32 % 16 / 16f, -32 / 16 / 16f, 0f), "玻璃砖"),
				new CarItem(),
				new TractorItem(),
				new MeshItem("整流器","Rectifier", "Models/MotionDetector", "MotionDetector", IndustrialModLoader.BaseTexture, Color.White, Matrix.CreateTranslation(new Vector3(0.5f)), Matrix.CreateScale(20f), "整流器", 2f),
				new MeshItem("可控硅", "ScR", "Models/Photodiode", "Photodiode", IndustrialModLoader.BaseTexture, Color.White, Matrix.CreateTranslation(new Vector3(0.5f)), Matrix.CreateScale(20f), "可控硅", 2f),
				new MeshItem("LED贴片", "LEDSheet", "Models/MotionDetector", "MotionDetector", IndustrialModLoader.BaseTexture, Color.White, Matrix.CreateTranslation(new Vector3(0.5f)), Matrix.CreateScale(20f), "LED贴片", 2f),
				new SpringItem(),
				new SpringboardItem(),
				new PlateItem("散热片", "HeatEmitter", Color.White, true)
				.AppendMesh("Models/Ingots", "IronPlate", Matrix.CreateTranslation(0.5f, -0.6f, 0.5f) * Matrix.CreateScale(.5f), Matrix.CreateTranslation(2 / 16f, 0, 0), Color.White)
				.AppendMesh("Models/Ingots", "IronPlate", Matrix.CreateTranslation(0.5f, -0.3f, 0.5f) * Matrix.CreateScale(.5f), Matrix.CreateTranslation(2 / 16f, 0, 0), Color.White)
				.AppendMesh("Models/Ingots", "IronPlate", Matrix.CreateTranslation(0.5f, 0.3f, 0.5f) * Matrix.CreateScale(.5f), Matrix.CreateTranslation(2 / 16f, 0, 0), Color.White)
				.AppendMesh("Models/Ingots", "IronPlate", Matrix.CreateTranslation(0.5f, 0.6f, 0.5f) * Matrix.CreateScale(.5f), Matrix.CreateTranslation(2 / 16f, 0, 0), Color.White),
				new MeshItem("电容")
				.AppendMesh("Models/Rods", "SteelRod", Matrix.CreateTranslation(0f, -0.8f, 0f), Matrix.Identity, Color.White)
				.AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(.7f) * Matrix.CreateTranslation(0f, -0.8f, 0f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), Color.DarkGray),
				new MeshItem("火花塞")
			    .AppendMesh("Models/Rods", "SteelRod", Matrix.CreateScale(.6f) * Matrix.CreateTranslation(0f, -0.5f, 0f), Matrix.Identity, Color.White)
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(.2f, .6f, .2f) * Matrix.CreateTranslation(0f, -0.3f, 0f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), Color.LightGray),
			    new PowderItem("聚乙烯", "PE", Color.White),
			    new PowderItem("聚丙烯", "PP", Color.White),
			    new PlateItem("聚乙烯板","聚乙烯板", Color.White,false),
			    new PlateItem("聚乙烯片","聚乙烯片", Color.White, true),
			    new RodItem(Materials.Plastic),
			    new RodItem(Materials.Uranium),
			    new MeshItem( "不锈钢板","Models/Brick", "Brick", Matrix.CreateScale(2f, 0.5f, 1f)*Matrix.CreateScale(3f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f),Color.White),
			    new MeshItem("工业钢板","Models/Brick", "Brick", Matrix.CreateScale(2f, 0.5f, 1f)*Matrix.CreateScale(3f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f),Color.White),
			    new MeshItem("炮钢棍","Models/Rods", "SteelRod", Matrix.CreateTranslation(0f,-0.5f,0f) * Matrix.CreateScale(4f, 2f, 4f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f),Color.White),
			    new MeshItem("枪管","Models/Rods", "SteelRod", Matrix.CreateTranslation(0f,-0.5f,0f) * Matrix.CreateScale(4f, 2f, 4f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f), Color.White),
			    //new item("玻璃瓶", "Bottle"),
			    //new Bottle("酒精", "C2H5OH"),
			    new MeshItem("RubberWheel")
			    .AppendMesh("Models/Wheel", "Wheel",  Matrix.CreateTranslation(0.0f, 0f, 0.1f), Matrix.CreateTranslation(9f / 16f, -15f / 16f, 0f)* Matrix.CreateScale(40f), Color.White)
			    .AppendMesh("Models/Wheel", "Wheel",  Matrix.CreateTranslation(0f, 0f, 0f)*Matrix.CreateScale(2f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f)* Matrix.CreateScale(20f), Color.Black),
			    new MeshItem("望远镜","Telescope", "Models/Battery", "Battery", Matrix.CreateRotationX(MathUtils.PI / 2) * Matrix.CreateScale(.5f, .5f, 1.2f) * Matrix.CreateTranslation(0.5f, 0.5f, -0.3f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f),"",1f)
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateRotationX(MathUtils.PI / 2) * Matrix.CreateScale(.7f) * Matrix.CreateTranslation(0.5f, 0.5f, 0.5f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), Color.DarkGray),
			    //new Digger(),
			    new MeshItem("注射器","Syringe", "Models/Screwdriver", "obj1", Matrix.CreateRotationZ(0.5f) * Matrix.CreateTranslation(0f, -0.33f, 0f), Matrix.CreateTranslation(15f / 16f, 0f, 0f),  "注射器", 3f),
			    new MeshItem("晶圆","Models/Battery", "Battery", Matrix.CreateTranslation(new Vector3(0.5f)) * Matrix.CreateScale(2f, 0.15f, 2f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f),  "晶圆"),
			    new PowderItem("U235", "U235P", Color.LightGreen),
			    new PowderItem("U238", "U238P", Color.DarkGreen),
			    new MeshItem("U235C","Models/Rods", "SteelRod", Matrix.CreateTranslation(0f,-0.5f,0f) * Matrix.CreateScale(16f,0.5f, 16f), Matrix.CreateTranslation(9f / 16f, -3f / 16f, 0f) * Matrix.CreateScale(20f),Color.LightGreen),
			    new MeshItem("U238C","Models/Rods", "SteelRod", Matrix.CreateTranslation(0f,-0.5f,0f) * Matrix.CreateScale(16f,0.5f, 16f), Matrix.CreateTranslation(9f / 16f, -3f / 16f, 0f) * Matrix.CreateScale(20f),Color.DarkGreen),
			    //new Wire("CopperWire"),
			    //new Circuit("Circuit1", "初级电路板", "初级电路板，由电线，电子管够成的电路板"),
			    new MeshItem("电子二极管")
			    .AppendMesh("Models/Rods", "SteelRod", Matrix.CreateTranslation(0.2f, -0.8f, 0f), Matrix.Identity, Color.White)
			    .AppendMesh("Models/Rods", "SteelRod", Matrix.CreateTranslation(-0.2f, -0.8f, 0f), Matrix.Identity, Color.White)
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(.7f) * Matrix.CreateTranslation(0f, -0.8f, 0f), Matrix.CreateTranslation(-32 % 16 / 16f, -32 / 16 / 16f, 0f) * Matrix.CreateScale(20f), new Color(255, 255, 255, 32)),
			    //new Tank(),
			    new MeshItem("液压元件")
			    .AppendMesh("Models/Rods", "SteelRod", Matrix.CreateTranslation(-0.0f, -0.8f, 0f), Matrix.Identity, Color.White)
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(.5f) * Matrix.CreateTranslation(0f, -0.8f, 0f),  Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), Color.Gray)
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(.5f) * Matrix.CreateTranslation(0f, 0.1f, 0f),  Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), Color.Black),
			    new MeshItem( "炮管(未镗)","Cannon", "Models/Battery", "Battery",  Matrix.CreateScale(.8f, 2.0f, .8f)*Matrix.CreateRotationX(MathUtils.PI / 2)  * Matrix.CreateTranslation(0.5f, 0.5f, -0.3f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), "炮管(未镗)", 1f),
			    new MeshItem( "炮管","CannonB", "Models/Battery", "Battery",  Matrix.CreateScale(.8f, 2.0f, .8f)*Matrix.CreateRotationX(MathUtils.PI / 2)  * Matrix.CreateTranslation(0.5f, 0.5f, -0.3f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), "炮管", 0.9f),
			    new MeshItem("CarbonTunnel","Models/Rods", "SteelRod", Matrix.CreateTranslation(0f,-0.5f,0f) * Matrix.CreateScale(4f,1.5f, 4f), Matrix.CreateTranslation(9f / 16f, -3f / 16f, 0f) * Matrix.CreateScale(20f),Color.Black),
			    //new Brick("PlasticBar", "PlasticBar", Color.White, Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), "塑料条",1.5f),
			    new MeshItem("RubyCyrstal")
			    .AppendMesh("Models/Diamond", "Diamond", Matrix.CreateTranslation(0.0f, 0f, 0.0f)*Matrix.CreateScale(0.8f), Matrix.CreateTranslation(9f / 16f, -12f / 16f, 0f), Color.LightRed),
			    //new Brick("RubyMaterial", "RubyMaterial", Color.LightRed, Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), "红宝石介质",0.8f),
			    new MeshItem("电阻")
			    .AppendMesh("Models/Rods", "SteelRod", Matrix.CreateScale(1.5f)*Matrix.CreateTranslation(0.0f, -0.7f, 0.0f)  * Matrix.CreateRotationX(1.5f), Matrix.Identity, Color.White)
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(.7f) * Matrix.CreateTranslation(0f, -0.3f, 0f)* Matrix.CreateRotationX(1.5f), Matrix.CreateTranslation(9 / 16f,-7 / 16 / 16f, 0f) * Matrix.CreateScale(20f), Color.Black),
			    new MeshItem("晶体三极管")
			    .AppendMesh("Models/Rods", "SteelRod", Matrix.CreateTranslation(0.25f, -0.8f, 0f), Matrix.Identity, Color.White)
			    .AppendMesh("Models/Rods", "SteelRod", Matrix.CreateTranslation(0.0f, -0.8f, 0f), Matrix.Identity, Color.White)
			    .AppendMesh("Models/Rods", "SteelRod", Matrix.CreateTranslation(-0.25f, -0.8f, 0f), Matrix.Identity, Color.White)
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(1f,.7f,1f) * Matrix.CreateTranslation(0f, -0.3f, 0f), Matrix.CreateTranslation(9 / 16f,-7 / 16 / 16f, 0f) * Matrix.CreateScale(20f), Color.Black),

			    //new Circuit("Circuit2", "高级电路板", "高级电路板，由锡线，晶体管够成的电路板",195),
			    //new Pavior(),
			    new MeshItem("电子枪","Models/Electrongun", "Electrongun", Matrix.CreateRotationX(MathUtils.PI / 2) * Matrix.CreateTranslation(0.5f, 0.5f, -0.3f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f),"",.6f),
			    //new ETrain(),
			    //new Airplane(),
			    new MeshItem("用尽的核燃料", "Models/Rods", "SteelRod", Matrix.CreateTranslation(0.0f, -0.5f, 0f)* Matrix.CreateScale(1.6f,1f,1.6f), Matrix.Identity,"用尽的核燃料",2.3f),
			    new PowderItem("PU239P", "PU239P", Color.DarkGray),
			    new MeshItem("PU239C", "Models/Rods", "SteelRod", Matrix.CreateTranslation(0f,-0.5f,0f) * Matrix.CreateScale(16f,0.5f, 16f), Matrix.CreateTranslation(9f / 16f, -3f / 16f, 0f) * Matrix.CreateScale(20f),Color.DarkGray),
			    new FlatItem("中子反射板","可以反射一部分中子",154),
			    //new MGun(),
			    new MeshItem("火箭发动机","火箭发动机","火箭发动机，火箭的必备组件，提供强大的推力")
			    .AppendMesh("Models/EmptyBucket", "Bucket", Matrix.CreateScale(1f)*Matrix.CreateTranslation(0.0f, 0.5f, 0.0f)  * Matrix.CreateRotationX(1.5f), Matrix.CreateTranslation(9f / 16f,-12f / 16 / 16f, 0f), Color.Black)
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(1.2f) * Matrix.CreateTranslation(0f, -0.6f, 0f)* Matrix.CreateRotationX(1.5f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), Color.Gray),
			    new MeshItem("液态氢","LH2","Models/Cylinder", "obj1", Matrix.CreateScale(40f, 80f, 40f) * Matrix.CreateTranslation(0.5f, 0f, 0.5f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f),"液态氢", 1.5f),
			    new MeshItem("液态氧","LO2","Models/Cylinder", "obj1", Matrix.CreateScale(40f, 80f, 40f) * Matrix.CreateTranslation(0.5f, 0f, 0.5f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f),"液态氧", 1.5f),
			    new MeshItem("液态D2","LD2","Models/Cylinder", "obj1", Matrix.CreateScale(40f, 80f, 40f) * Matrix.CreateTranslation(0.5f, 0f, 0.5f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f),  "液态D2", 1.5f),
			    new MeshItem("液态氮", "LN2","Models/Cylinder", "obj1", Matrix.CreateScale(40f, 80f, 40f) * Matrix.CreateTranslation(0.5f, 0f, 0.5f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), "液态氮", 1.5f),
			    new MeshItem("液态氯","LCl2","Models/Cylinder", "obj1", Matrix.CreateScale(40f, 80f, 40f) * Matrix.CreateTranslation(0.5f, 0f, 0.5f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f),  "液态氯", 1.5f),
			    new MeshItem("钛合金板","Models/Brick", "Brick", Matrix.CreateScale(2f, 0.5f, 1f)*Matrix.CreateScale(3f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f),  "钛合金板"),
			    //new Rocket(),
			    new MeshItem("卫星","卫星","给予提供侦察功能")
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(0.7f) * Matrix.CreateTranslation(0f, -0.3f, 0f) * Matrix.CreateRotationZ(1.5f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), Color.DarkGray)
			    .AppendMesh("Models/EmptyBucket", "Bucket", Matrix.CreateScale(0.6f)*Matrix.CreateTranslation(0.05f, 0.3f, 0.0f)  * Matrix.CreateRotationZ(-1.5f), Matrix.CreateTranslation(9f / 16f,-12f / 16 / 16f, 0f), Color.Black)
			    .AppendMesh("Models/Brick", "Brick",Matrix.CreateScale(1f, 0.015f, 3f)*Matrix.CreateScale(1.8f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f), Color.Blue),
			    new MeshItem("卫星连接器","卫星连接器，可以探查地形。")
			    .AppendMesh("Models/Brick", "Brick", Matrix.CreateScale(1f, 0.25f, 1f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f), Color.Black)
			    .AppendMesh("Models/Brick", "Brick", Matrix.CreateScale(0.5f, 0.25f, 0.5f)*Matrix.CreateTranslation(0f,0.05f,0f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f), Color.Gray),
			    //new Submarine(),
			    //new Cannon(),
			    new MeshItem("测距仪", "Models/Battery", "Battery", Matrix.CreateRotationX(MathUtils.PI / 2) * Matrix.CreateScale(.5f, .5f, 1.2f) * Matrix.CreateTranslation(0.5f, 0.5f, -0.3f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), "测距仪", 0.6f)
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateRotationX(MathUtils.PI / 2) * Matrix.CreateScale(.7f) * Matrix.CreateTranslation(0.5f, 0.5f, 0.5f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), Color.DarkGray),
			    //new Circuit("Circuit3", "集成电路", "集成电路，由光刻机制作的集成电路板",198),
			    new MeshItem("超导体")
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(1f,.5f,1f) * Matrix.CreateTranslation(0f, -0.3f, 0f), Matrix.CreateTranslation(3f / 16f, -14f / 16f, 0f) * Matrix.CreateScale(20f), Color.LightGray),
			    new MeshItem("遥控器")
			    .AppendMesh("Models/Brick", "Brick", Matrix.CreateScale(1f, 0.25f, 1f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f), Color.Black)
			    .AppendMesh("Models/Brick", "Brick", Matrix.CreateScale(0.5f, 0.25f, 0.5f)*Matrix.CreateTranslation(0f,0.05f,0f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f), Color.Gray),
			    //new AutoTank(),
			    new MeshItem("TiRubyCyrstal")
			    .AppendMesh("Models/Diamond", "Diamond", Matrix.CreateTranslation(0.0f, 0f, 0.0f)*Matrix.CreateScale(0.8f), Matrix.CreateTranslation(9f / 16f, -12f / 16f, 0f), Color.LightMagenta),
			    //new Brick("TiRubyMaterial", "TiRubyMaterial", Color.LightMagenta, Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), "钛红宝石介质",0.8f),
			    new MeshItem("D靶丸")
			    .AppendMesh("Models/Diamond", "Diamond", Matrix.CreateTranslation(0.0f, 0f, 0.0f)*Matrix.CreateScale(1.5f), Matrix.CreateTranslation(9f / 16f, -12f / 16f, 0f), Color.DarkGray),
			    //new Rocket3(),
			    //new Back(),
			    new MeshItem("火箭弹")
			    .AppendMesh("Models/Ra2", "Cylinder", Matrix.CreateTranslation(0.0f, -0.3f, 0.0f)*Matrix.CreateScale(1.5f), Matrix.CreateTranslation(9f / 16f, -12f / 16f, 0f), Color.DarkGray),
			    new MeshItem("灭火器","灭火器，按压式灭火器，可以扑灭小规模的火焰")
			    .AppendMesh("Models/Brick", "Brick", Matrix.CreateScale(1f, 0.25f, 1f)*Matrix.CreateTranslation(0f,0.65f,0f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f), Color.Black)
			    .AppendMesh("Models/Brick", "Brick", Matrix.CreateScale(0.5f, 1.25f, 0.5f)*Matrix.CreateTranslation(0f,0.45f,0f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f), Color.Gray)
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(1f,1f,1f) * Matrix.CreateTranslation(0f, -0.6f, 0f), Matrix.CreateTranslation(3f / 16f, -14f / 16f, 0f) * Matrix.CreateScale(20f), Color.Black),
			    new MeshItem("金属探测器","一种可以简单探测附近金属矿物的仪器")
			    .AppendMesh("Models/Brick", "Brick", Matrix.CreateScale(1f, 0.25f, 1f)*Matrix.CreateTranslation(0f,-0.65f,0f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f), Color.Black)
			    .AppendMesh("Models/Brick", "Brick", Matrix.CreateScale(0.5f, 0.25f, 0.5f)*Matrix.CreateTranslation(0f,0.45f,0f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f) * Matrix.CreateScale(20f), Color.Gray)
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(0.1f,1.2f,0.1f) * Matrix.CreateTranslation(0f, -0.6f, 0f), Matrix.CreateTranslation(3f / 16f, -14f / 16f, 0f) * Matrix.CreateScale(20f), Color.Black),
			    new PowderItem("合成淀粉", "starch", new Color(215, 215, 215)),
			    //new Bottle("植物汁液", "treeliquid",Color.Green),
			    //new Bottle("Enzyme-A", "EA",Color.LightBlue),
			    //new Bottle("Enzyme-B", "EB",Color.LightGreen),
			    //new Bottle("Enzyme-C", "EC",Color.LightYellow),
			    //new Bottle("Enzyme-D", "ED",Color.LightCyan),
			    new MeshItem("光合作用组件")
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(1.5f,.5f,1.5f) * Matrix.CreateTranslation(0f, -0.3f, 0f), Matrix.CreateTranslation(3f / 16f, -14f / 16f, 0f) * Matrix.CreateScale(20f), new Color(255, 255, 255, 32))
			    .AppendMesh("Models/Battery", "Battery", Matrix.CreateScale(1.2f,.6f,1.2f) * Matrix.CreateTranslation(0f, -0.3f, 0f), Matrix.CreateTranslation(3f / 16f, -14f / 16f, 0f) * Matrix.CreateScale(20f), Color.LightGreen),
			    new MeshItem("电视导弹")
			    .AppendMesh("Models/Ra2", "Cylinder", Matrix.CreateTranslation(0.0f, -0.3f, 0.0f)*Matrix.CreateScale(2.0f), Matrix.CreateTranslation(3f / 16f, -7f / 16f, 0f)*Matrix.CreateScale(0.01f), Color.White),
			    //new MeshItem("LH2","Models/Cylinder", "obj1", Matrix.CreateScale(40f, 80f, 40f) * Matrix.CreateTranslation(0.5f, 0f, 0.5f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), "液态氢", "液态氢", 1.5f),
			    //new MeshItem("LO2","Models/Cylinder", "obj1", Matrix.CreateScale(40f, 80f, 40f) * Matrix.CreateTranslation(0.5f, 0f, 0.5f), Matrix.CreateTranslation(9f / 16f, -7f / 16f, 0f), "液态氧", "液态氧", 1.5f),
			    //new Plane(),
			    /*nnew Plate("128K RAM", Color.DarkGreen, true),
			    new Plate("256K RAM", Color.DarkGreen, true),
			    new Plate("512K RAM", Color.DarkGreen, true),
			    new Plate("RISC CPU", Color.DarkGray, true),
			    new Plate("CISC CPU", Color.DarkGray, true),
			    new CPanel(),*/
#endif
			];
            }
            catch (Exception e) {
                Console.WriteLine(e);
                throw;
            }
			//初始化ID对应表
			IdMap = new Dictionary<string, int>();
			int itemIndex = 0;
			foreach (var itemBlock in Items) {
                //创建完整值
				int id = Terrain.MakeBlockValue(BaseItemBlock.Index, 0, itemIndex++);
				IdMap.Add(itemBlock.GetCraftingId(), id);

			}
        }

        public static void LateInit() {
            //创建合成谱
            foreach (var itemBlock in Items) {
                CraftingRecipesManager.m_recipes.AddRange(itemBlock.GenerateProceduralRecipe(GetItemID(itemBlock)));
            }
        }

        /// <summary>
		/// 通过方块完整值获取对应类的实例
		/// </summary>
		/// <param name="value"></param>
		/// <returns></returns>
		public static ItemBlock GetItem(int value) {
			int index = Terrain.ExtractData(value);
			if(index < Items.Length) return Items[index];
			return Items[0];
		}

        /// <summary>
        /// 通过方块字符串ID获取对应类的实例
        /// </summary>
        /// <param name="craftingID"></param>
        /// <returns></returns>
		public static ItemBlock GetItem(string craftingID) => GetItem(IdMap[craftingID]);

        /// <summary>
        /// 获取字符串ID对应的方块ID
        /// </summary>
        /// <param name="craftingID"></param>
        /// <returns></returns>
        public static int GetItemID(string craftingID) => IdMap.ContainsKey(craftingID) ? IdMap[craftingID] : -1;

        /// <summary>
        /// 通过物品方块实例获取其数字ID
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public static int GetItemID(ItemBlock item) => IdMap[item.GetCraftingId()];

        /// <summary>
        /// 通过材料获取某材料方块实例
        /// </summary>
        /// <param name="material"></param>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public static T? GetItemByMaterial<T>(Materials material) where T : ItemBlock, IMaterialBlock{
            ItemBlock[] items = Items.Where(x => x.GetType() == typeof(T)).ToArray();
            foreach (var item in items) {
                IMaterialBlock? materialBlock = item as IMaterialBlock ?? null;
                if(materialBlock != null && materialBlock.GetMaterial() != material) continue;
                return item as T;
            }
            return null;
        }

        /// <summary>
        /// 通过材料获取某材料方块实例
        /// </summary>
        /// <param name="itemType">方块的类型</param>
        /// <param name="material">材料类型</param>
        /// <returns>指定材料的方块实例</returns>
        public static ItemBlock? GetItemByMaterial(Type itemType, Materials material) {
            if (!typeof(ItemBlock).IsAssignableFrom(itemType)
                || !typeof(IMaterialBlock).IsAssignableFrom(itemType)) {
                throw new ArgumentException("itemType must be of type ItemBlock and implement IMaterialBlock");
            }

            // 找到所有指定类型的 ItemBlock 实例
            ItemBlock[] items = Items.Where(x => x.GetType() == itemType).ToArray();
            foreach (var item in items) {
                IMaterialBlock? materialBlock = item as IMaterialBlock;
                if (materialBlock != null && materialBlock.GetMaterial() != material) {
                    continue;
                }
                return item;
            }
            return null;
        }

        /// <summary>
        /// 通过材料获取某方块ID
        /// </summary>
        /// <param name="material"></param>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public static int GetItemIdByMaterial<T>(Materials material) where T : ItemBlock, IMaterialBlock{
            //特例
            if (material == Materials.Iron) {
                if (typeof(T) == typeof(MetalIngotItem)) return IronIngotBlock.Index;
                if (typeof(T) == typeof(RodItem)) return RodBlock.Index;
                if (typeof(T) == typeof(OreChunkItem)) return IronOreChunkBlock.Index;
            }
            else if(material == Materials.Copper) {
                if (typeof(T) == typeof(MetalIngotItem)) return CopperIngotBlock.Index;
                if (typeof(T) == typeof(OreChunkItem)) return MalachiteChunkBlock.Index;
            }
            else if (material == Materials.Germanium) {
                if (typeof(T) == typeof(OreChunkItem)) return GermaniumOreChunkBlock.Index;
            }
            //通解
            T? item = GetItemByMaterial<T>(material);
            if (item != null) {
                return GetItemID(item);
            }
            return 0;
        }

        /// <summary>
        /// 通过材料获取某方块ID
        /// </summary>
        /// <param name="material"></param>
        /// <param name="itemType"></param>
        /// <returns></returns>
        public static int GetItemIdByMaterial(Type itemType, Materials material) {
            if (!typeof(ItemBlock).IsAssignableFrom(itemType)
                || !typeof(IMaterialBlock).IsAssignableFrom(itemType)) {
                throw new ArgumentException("itemType must be of type ItemBlock and implement IMaterialBlock");
            }

            // 特例
            if (material == Materials.Iron) {
                if (itemType == typeof(MetalIngotItem)) return IronIngotBlock.Index;
                if (itemType == typeof(RodItem)) return RodBlock.Index;
                if (itemType == typeof(OreChunkItem)) return IronOreChunkBlock.Index;
            }
            else if (material == Materials.Copper) {
                if (itemType == typeof(MetalIngotItem)) return CopperIngotBlock.Index;
                if (itemType == typeof(OreChunkItem)) return MalachiteChunkBlock.Index;
            }
            else if (material == Materials.Germanium) {
                if (itemType == typeof(OreChunkItem)) return GermaniumOreChunkBlock.Index;
            }

            // 通解
            var item = GetItemByMaterial(itemType, material);
            if (item != null) {
                return GetItemID(item);
            }
            return 0;
        }


        /// <summary>
        /// 通过物品数字ID获取物品字符串ID
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static string GetItemCraftingID(int value) => GetItem(value).GetCraftingId();

		public static void AppendMesh(this BlockMesh blockMesh, string modelName, string meshName, Matrix boneTransform, Matrix tcTransform, Color color)
		{
			var model = ContentManager.Get<Model>(modelName);
			blockMesh.AppendModelMeshPart(model.FindMesh(meshName).MeshParts[0], BlockMesh.GetBoneAbsoluteTransform(model.FindMesh(meshName).ParentBone) * boneTransform, false, false, false, false, color);
			if (tcTransform != Matrix.Identity)
				blockMesh.TransformTextureCoordinates(tcTransform);
		}

		public static BlockMesh CreateRing()
		{
			var mesh = new BlockMesh();
			var m = Matrix.CreateScale(0.7f, 0.15f, 0.7f) * Matrix.CreateTranslation(0.5f, 0f, 0f) * Matrix.CreateRotationX(MathUtils.PI / 2);
			for (float i = 0; i < 8 * MathUtils.PI; i += MathUtils.PI / 12)
				mesh.AppendMesh("Models/Rods", "SteelRod", m * Matrix.CreateTranslation(0, 0.03f * i - 0.5f, 0) * Matrix.CreateRotationY(i), Matrix.Identity, Color.White);
			return mesh;
		}
	}
}